package com.ymatou.iapi.refund.service;

import org.json.JSONException;
import org.json.JSONObject;

import com.ymatou.iapi.refund.parameter.GetReturnReasonsV2Resp;
import com.ymt.base.YmatouBaseCall;
import com.ymt.core.tool.FormatUtil;

import com.ymttest.utils.EnvSetup;
/**
*获取最大可退金额Call
*FreeMaker Template自动生成代码
*/
public class GetReturnReasonsV2Call extends YmatouBaseCall{
	private static String opurl ="api/Returns/ReturnBill/GetReturnReasonsV2";
	
	public GetReturnReasonsV2Call() {
		super(EnvSetup.getSystemUrl("refund_iapi"),opurl,"GET","PARAM");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	
	
	/**
	 * 获取getReturnData
	 * 
	 * @return
	 */
	public String getReturnData1() {
		String Code = null;
		try {
			Code = getReturnData();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return Code;
	}
	
	 public String getMsg1()
	    {
	        return getString("Msg");
	    }
	 
	 public String getStatus()
	    {
	        return getString("Status");
	    }
	 
	 public String getbCode()
	  {
	        return getString("bCode");
	  }
	 
//	 public JSONObject getRetData() throws JSONException
//	  {
//	        return new JSONObject(getString("RetData"));
//	  }
	 
	 
	  public GetReturnReasonsV2Resp getCallData()
	  {
			GetReturnReasonsV2Resp data = null;
			try {
				data = (GetReturnReasonsV2Resp) FormatUtil.GSONToObject(this.getReturnData(), GetReturnReasonsV2Resp.class);
			} catch (Exception e) {
				e.printStackTrace();
			}
			return data;
	  }
}